/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2022/12/15 11:03
 * @copyright: 博为峰
 */
public class Programmer {
    public String name;
    //私有的（本类中可以访问）
    private int age;
    private double salary;

    public void setAge(int age) {
        if (age < 0) {
            System.out.println("年龄范围1-150");
        } else {
            this.age = age;
        }
    }

    public int getAge() {
        return age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public Programmer() {
    }

    public Programmer(String name, int age, double salary) {
        this.name = name;
        this.age = age;
        this.salary = salary;
    }
}
